<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>找,的位置</title>
	</head>
	<body>
		<script>
			var name = "1234565555785900023334555";
			var weizhi = name.indexOf("5");
			var count = 0;
			while(weizhi != -1){
				weizhi = name.indexOf("5",weizhi+1);
				count++;
			}
			alert(count);
		</script>
	</body>
</html>
